<template>
  <div class="home">
    <h1>工作流引擎系统</h1>
    <div class="card-container">
      <div class="card" @click="goToProcessDesigner">
        <h2>流程设计器</h2>
        <p>设计和部署工作流程图</p>
      </div>
      <div class="card" @click="goToTaskList">
        <h2>任务管理</h2>
        <p>查看和处理待办任务</p>
      </div>
      <div class="card" @click="goToFormDesigner">
        <h2>表单设计器</h2>
        <p>创建和管理流程表单</p>
      </div>
    </div>
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router';

const router = useRouter();

const goToProcessDesigner = () => {
  router.push('/process-designer');
};

const goToTaskList = () => {
  router.push('/task-list');
};

const goToFormDesigner = () => {
  router.push('/form-designer');
};
</script>

<style scoped>
.home {
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

h1 {
  text-align: center;
  margin-bottom: 40px;
  color: #333;
}

.card-container {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 20px;
}

.card {
  flex: 1;
  min-width: 250px;
  max-width: 350px;
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  background-color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.card h2 {
  margin-top: 0;
  color: #42b983;
}

.card p {
  color: #666;
}
</style>